# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-python-pushsafer
_pkgname=python-pushsafer
pkgver=1.1
pkgrel=5
_pyver=3.13
pkgdesc='Comprehensive bindings for the Pushsafer.com notification service.'
arch=('any')
url='https://pypi.org/project/python-pushsafer/#files'
license=('GPL3')
depends=('python' 'python-requests')
makedepends=('python-build' 'python-pip')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('764d54d713ad4866f0949b42d8571e4d12f8621bcbedeb63bbabaac83d8902a2f9f7cb4347a66fbe030e5f47871912106c46cdff24a8f419710d114a9dae37ff')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/lib/python$_pyver/site-packages/$_pkgname/"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname

  # don't know what to say...
  cp "$pkgdir/usr/lib/python$_pyver/site-packages/pushsafer.py" \
    "$pkgdir/usr/lib/python$_pyver/site-packages/$_pkgname/"
  touch "$pkgdir/usr/lib/python$_pyver/site-packages/$_pkgname/__init__.py"
}

